package com.taobao.txc.client;

import org.apache.commons.lang.StringUtils;

public class TxcTransaction
  extends com.taobao.txc.common.d.a
{
  private a a = null;
  private String b = null;
  private static TxcTransaction c;
  
  public static TxcTransaction getInstance(String paramString1, String paramString2, String paramString3)
  {
    if ((StringUtils.isEmpty(paramString1)) || (StringUtils.isEmpty(paramString2)) || (StringUtils.isEmpty(paramString3))) {
      throw new RuntimeException("input parameter for create TxcTransaction is invalid!");
    }
    if (c == null) {
      synchronized (TxcTransaction.class)
      {
        if (c == null)
        {
          a locala = a.a(paramString1, paramString1, 1, null, paramString2, paramString3, 0);
          c = new TxcTransaction();
          c.a = locala;
          c.b = paramString1;
        }
      }
    }
    return c;
  }
  
  public static TxcTransaction getInstance(String paramString1, String paramString2)
  {
    if ((StringUtils.isEmpty(paramString1)) || (StringUtils.isEmpty(paramString2))) {
      throw new RuntimeException("input parameter for create TxcTransaction is invalid!");
    }
    if (c == null) {
      synchronized (TxcTransaction.class)
      {
        if (c == null)
        {
          a locala = a.a(paramString1, paramString2, 1);
          c = new TxcTransaction();
          c.a = locala;
          c.b = paramString1;
        }
      }
    }
    return c;
  }
  
  public void begin(long paramLong)
  {
    String str = c();
    this.a.a().a(paramLong, this.b, str);
  }
  
  public void commit()
  {
    this.a.a().a();
  }
  
  public void rollback()
  {
    this.a.a().b();
  }
  
  private String c()
  {
    StackTraceElement[] arrayOfStackTraceElement = Thread.currentThread().getStackTrace();
    if (arrayOfStackTraceElement.length < 4) {
      throw new RuntimeException("caller stack is incomplete!");
    }
    StackTraceElement localStackTraceElement = arrayOfStackTraceElement[3];
    return localStackTraceElement.getClassName() + "." + localStackTraceElement.getMethodName();
  }
}


/* Location:           C:\Users\ibm\Downloads\txc-yun-sample (1)\txc-yun-sample\lib\txc-client-2.0.72.jar
 * Qualified Name:     com.taobao.txc.client.TxcTransaction
 * JD-Core Version:    0.7.0.1
 */